home *** CD-ROM | disk | FTP | other *** search
/ Aminet 52 / Aminet 52 (2002)(GTI - Schatztruhe)[!][Dec 2002].iso / Aminet / dev / gg / ncurses-5.3.lha / ncurses-5.3 / progs / Makefile < prev    next >
Makefile  |  2002-10-24  |  11KB  |  361 lines

  1. # $Id: Makefile.in,v 1.56 2001/12/08 18:48:01 tom Exp $
  2. ##############################################################################
  3. # Copyright (c) 1998,1999,2000,2001 Free Software Foundation, Inc.           #
  4. #                                                                            #
  5. # Permission is hereby granted, free of charge, to any person obtaining a    #
  6. # copy of this software and associated documentation files (the "Software"), #
  7. # to deal in the Software without restriction, including without limitation  #
  8. # the rights to use, copy, modify, merge, publish, distribute, distribute    #
  9. # with modifications, sublicense, and/or sell copies of the Software, and to #
  10. # permit persons to whom the Software is furnished to do so, subject to the  #
  11. # following conditions:                                                      #
  12. #                                                                            #
  13. # The above copyright notice and this permission notice shall be included in #
  14. # all copies or substantial portions of the Software.                        #
  15. #                                                                            #
  16. # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR #
  17. # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,   #
  18. # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL    #
  19. # THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER      #
  20. # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING    #
  21. # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER        #
  22. # DEALINGS IN THE SOFTWARE.                                                  #
  23. #                                                                            #
  24. # Except as contained in this notice, the name(s) of the above copyright     #
  25. # holders shall not be used in advertising or otherwise to promote the sale, #
  26. # use or other dealings in this Software without prior written               #
  27. # authorization.                                                             #
  28. ##############################################################################
  29. #
  30. # Author: Thomas E. Dickey <dickey@clark.net> 1996,1997
  31. #
  32. # Makefile for ncurses source code.
  33. #
  34. # This makes the ncurses utility programs.
  35. #
  36. # The variable 'srcdir' refers to the source-distribution, and can be set with
  37. # the configure script by "--srcdir=DIR".
  38. #
  39. # The rules are organized to produce the libraries for the configured models,
  40. # and the programs with the configured default model.
  41.  
  42. # turn off _all_ suffix rules; we'll generate our own
  43. .SUFFIXES:
  44.  
  45. SHELL        = /bin/sh
  46. THIS        = Makefile
  47.  
  48. CF_MFLAGS     = 
  49.  
  50. x        = 
  51.  
  52. MODEL        = ../objects
  53. DESTDIR        = 
  54. srcdir        = .
  55. prefix        = /gg
  56. exec_prefix    = ${prefix}
  57. bindir        = ${exec_prefix}/bin
  58. libdir        = ${exec_prefix}/lib
  59. includedir    = $(prefix)/include/ncurses
  60. datadir        = ${prefix}/share
  61.  
  62. LIBTOOL        = 
  63.  
  64. INSTALL        = /bin/install -c
  65. INSTALL_PROGRAM    = ${INSTALL}
  66. transform    = s,x,x,
  67.  
  68. AWK        = gawk
  69. LN_S        = ln -s
  70.  
  71. CC        = gcc
  72. CPP        = gcc -E
  73. CFLAGS        = -O2 -fomit-frame-pointer -m68020-60 -ffast-math 
  74.  
  75. INCDIR        = $(srcdir)/../include
  76. CPPFLAGS    = -I../progs -I$(srcdir)  -DNDEBUG -I. -I../include -I$(includedir) \
  77.           -DHAVE_CONFIG_H
  78.  
  79. CCFLAGS        = $(CPPFLAGS) $(CFLAGS)
  80.  
  81. CFLAGS_LIBTOOL    = $(CCFLAGS)
  82. CFLAGS_NORMAL    = $(CCFLAGS)
  83. CFLAGS_DEBUG    = $(CCFLAGS) -g -DTRACE
  84. CFLAGS_PROFILE    = $(CCFLAGS) -pg
  85. CFLAGS_SHARED    = $(CCFLAGS) unknown
  86.  
  87. CFLAGS_DEFAULT    = $(CFLAGS_NORMAL)
  88.  
  89. LD        = ld
  90. LINK        =  $(LIBTOOL) $(CC)
  91. LDFLAGS        =  \
  92.         -L../lib -lncurses  -s -lm   
  93.  
  94. LDFLAGS_LIBTOOL    = $(LDFLAGS)
  95. LDFLAGS_NORMAL    = $(LDFLAGS)
  96. LDFLAGS_DEBUG    = $(LDFLAGS) -g
  97. LDFLAGS_PROFILE    = $(LDFLAGS) -pg
  98. LDFLAGS_SHARED    = $(LDFLAGS) 
  99.  
  100. LDFLAGS_DEFAULT    = $(LDFLAGS_NORMAL)
  101.  
  102. LINT        = 
  103. LINT_OPTS    = 
  104. LINT_LIBS    = -lncurses 
  105.  
  106. AUTO_SRC = \
  107.     termsort.c \
  108.     transform.h
  109.  
  110. # tic and toe rely on direct access to the terminfo database
  111. GET_PROGS = infocmp$x clear$x tput$x tset$x
  112. PUT_PROGS =  tic$x toe$x
  113. PROGS = $(PUT_PROGS) $(GET_PROGS)
  114.  
  115. TESTPROGS = mvcur$x tctest$x hardscroll$x hashmap$x
  116.  
  117. # Default library, for linking applications
  118. DEPS_CURSES = ../lib/libncurses.a
  119.  
  120. ################################################################################
  121. all:        $(AUTO_SRC) $(PROGS)
  122.  
  123. sources:    $(AUTO_SRC)
  124.  
  125. install:     $(AUTO_SRC) install.progs
  126. uninstall: uninstall.progs
  127.  
  128. # this line simplifies the configure-script
  129. libs \
  130. install.libs \
  131. uninstall.libs:
  132.  
  133. TRANSFORM = sed 's/$x$$//'|sed '$(transform)'|sed 's/$$/$x/'
  134.  
  135. actual_captoinfo = `echo captoinfo$x| $(TRANSFORM)`
  136. actual_clear     = `echo clear$x|     $(TRANSFORM)`
  137. actual_infocmp   = `echo infocmp$x|   $(TRANSFORM)`
  138. actual_infotocap = `echo infotocap$x| $(TRANSFORM)`
  139. actual_init      = `echo init$x|      $(TRANSFORM)`
  140. actual_reset     = `echo reset$x|     $(TRANSFORM)`
  141. actual_tic       = `echo tic$x|       $(TRANSFORM)`
  142. actual_toe       = `echo toe$x|       $(TRANSFORM)`
  143. actual_tput      = `echo tput$x|      $(TRANSFORM)`
  144. actual_tset      = `echo tset$x|      $(TRANSFORM)`
  145.  
  146. transform.h :
  147.     echo "#define PROG_CAPTOINFO \"$(actual_captoinfo)\"" >$@
  148.     echo "#define PROG_INFOTOCAP \"$(actual_infotocap)\"" >>$@
  149.     echo "#define PROG_RESET     \"$(actual_reset)\""     >>$@
  150.     echo "#define PROG_INIT      \"$(actual_init)\""      >>$@
  151.  
  152. install.progs: $(AUTO_SRC) $(PROGS) $(DESTDIR)$(bindir)
  153.     $(LIBTOOL) $(INSTALL_PROGRAM) tic$x     $(DESTDIR)$(bindir)/$(actual_tic)
  154.     $(LIBTOOL) $(INSTALL_PROGRAM) toe$x     $(DESTDIR)$(bindir)/$(actual_toe)
  155.     @echo "linking $(actual_infotocap) to $(actual_tic)"
  156.     -@rm -f $(DESTDIR)$(bindir)/$(actual_infotocap)
  157.     (cd $(DESTDIR)$(bindir) && $(LN_S) $(actual_tic) $(actual_infotocap))
  158.     @echo "linking $(actual_captoinfo) to $(actual_tic)"
  159.     -@rm -f $(DESTDIR)$(bindir)/$(actual_captoinfo)
  160.     (cd $(DESTDIR)$(bindir) && $(LN_S) $(actual_tic) $(actual_captoinfo))
  161.     $(LIBTOOL) $(INSTALL_PROGRAM) infocmp$x $(DESTDIR)$(bindir)/$(actual_infocmp)
  162.     $(LIBTOOL) $(INSTALL_PROGRAM) clear$x   $(DESTDIR)$(bindir)/$(actual_clear)
  163.     $(LIBTOOL) $(INSTALL_PROGRAM) tput$x    $(DESTDIR)$(bindir)/$(actual_tput)
  164.     $(LIBTOOL) $(INSTALL_PROGRAM) tset$x    $(DESTDIR)$(bindir)/$(actual_tset)
  165.     @echo "linking $(actual_reset) to $(actual_tset)"
  166.     -@rm -f $(DESTDIR)$(bindir)/$(actual_reset)
  167.     (cd $(DESTDIR)$(bindir) && $(LN_S) $(actual_tset) $(actual_reset))
  168.  
  169. uninstall.progs:
  170.     -@$(LIBTOOL) rm -f $(DESTDIR)$(bindir)/$(actual_tic)
  171.     -@$(LIBTOOL) rm -f $(DESTDIR)$(bindir)/$(actual_toe)
  172.     -@rm -f $(DESTDIR)$(bindir)/$(actual_captoinfo)
  173.     -@rm -f $(DESTDIR)$(bindir)/$(actual_infotocap)
  174.     -@$(LIBTOOL) rm -f $(DESTDIR)$(bindir)/$(actual_infocmp)
  175.     -@$(LIBTOOL) rm -f $(DESTDIR)$(bindir)/$(actual_clear)
  176.     -@$(LIBTOOL) rm -f $(DESTDIR)$(bindir)/$(actual_tput)
  177.     -@$(LIBTOOL) rm -f $(DESTDIR)$(bindir)/$(actual_tset)
  178.     -@rm -f $(DESTDIR)$(bindir)/$(actual_reset)
  179.  
  180. $(DESTDIR)$(bindir) :
  181.     sh $(srcdir)/../mkinstalldirs $@
  182.  
  183. #
  184. # Utilities normally built by make all start here
  185. #
  186.  
  187. DEPS_TIC = \
  188.     $(MODEL)/tic.o \
  189.     $(MODEL)/dump_entry.o
  190.  
  191. tic$x: $(DEPS_TIC) $(DEPS_CURSES) transform.h
  192.      $(LINK) $(DEPS_TIC) $(LDFLAGS_DEFAULT) -o $@
  193.  
  194. DEPS_TOE = \
  195.     $(MODEL)/toe.o \
  196.     $(MODEL)/dump_entry.o
  197.  
  198. toe$x: $(DEPS_TOE) $(DEPS_CURSES)
  199.      $(LINK) $(DEPS_TOE) $(LDFLAGS_DEFAULT) -o $@
  200.  
  201. DEPS_CLEAR = \
  202.     $(MODEL)/clear.o
  203.  
  204. clear$x: $(DEPS_CLEAR) $(DEPS_CURSES)
  205.      $(LINK) $(DEPS_CLEAR) $(LDFLAGS_DEFAULT) -o $@
  206.  
  207. DEPS_TPUT = \
  208.     $(MODEL)/tput.o
  209.  
  210. tput$x: $(DEPS_TPUT) $(DEPS_CURSES) transform.h
  211.      $(LINK) $(DEPS_TPUT) $(LDFLAGS_DEFAULT) -o $@
  212.  
  213. DEPS_INFOCMP = \
  214.     $(MODEL)/infocmp.o \
  215.     $(MODEL)/dump_entry.o
  216.  
  217. infocmp$x: $(DEPS_INFOCMP) $(DEPS_CURSES)
  218.      $(LINK) $(DEPS_INFOCMP) $(LDFLAGS_DEFAULT) -o $@
  219.  
  220. DEPS_TSET = \
  221.     $(MODEL)/tset.o \
  222.     $(MODEL)/dump_entry.o
  223.  
  224. tset$x: $(DEPS_TSET) $(DEPS_CURSES) transform.h
  225.      $(LINK) $(DEPS_TSET) $(LDFLAGS_DEFAULT) -o $@
  226.  
  227. termsort.c: $(srcdir)/MKtermsort.sh
  228.     sh -c "$(srcdir)/MKtermsort.sh $(AWK) $(srcdir)/../include/Caps" >$@
  229.  
  230. #
  231. # Utility productions start here
  232. #
  233.  
  234. tags:
  235.     ctags *.[ch]
  236.  
  237. #TAGS:
  238. #    etags *.[ch]
  239.  
  240. mostlyclean ::
  241.     -rm -f core tags TAGS *~ *.bak *.i *.ln *.atac trace
  242.     -rm -f $(TESTPROGS)
  243.  
  244. clean :: mostlyclean
  245.     -rm -f $(AUTO_SRC)
  246.     -rm -f $(PROGS)
  247.     -rm -rf .libs
  248.  
  249. distclean :: clean
  250.     -rm -f Makefile
  251.  
  252. realclean :: distclean
  253.  
  254. # These rules are used to allow "make -n" to work on a clean directory-tree
  255. ../include/hashsize.h \
  256. ../include/parametrized.h \
  257. ../include/term.h :
  258.     cd ../include; $(MAKE) $(CF_MFLAGS)
  259. $(DEPS_CURSES) :
  260.     cd ../ncurses; $(MAKE) $(CF_MFLAGS)
  261.  
  262. lint:
  263.     $(LINT) $(LINT_OPTS) $(CPPFLAGS) $(srcdir)/tic.c     $(srcdir)/dump_entry.c $(LINT_LIBS)
  264.     $(LINT) $(LINT_OPTS) $(CPPFLAGS) $(srcdir)/toe.c     $(srcdir)/dump_entry.c $(LINT_LIBS)
  265.     $(LINT) $(LINT_OPTS) $(CPPFLAGS) $(srcdir)/clear.c                          $(LINT_LIBS)
  266.     $(LINT) $(LINT_OPTS) $(CPPFLAGS) $(srcdir)/infocmp.c $(srcdir)/dump_entry.c $(LINT_LIBS)
  267.     $(LINT) $(LINT_OPTS) $(CPPFLAGS) $(srcdir)/tput.c                           $(LINT_LIBS)
  268.     $(LINT) $(LINT_OPTS) $(CPPFLAGS) $(srcdir)/tset.c    $(srcdir)/dump_entry.c $(LINT_LIBS)
  269.  
  270. ###############################################################################
  271. # The remainder of this file is automatically generated during configuration
  272. ###############################################################################
  273.  
  274. # generated by mk-0th.awk
  275.  
  276. .SUFFIXES: .c .cc .h .i .ii
  277. .c.i :
  278.     $(CPP) $(CPPFLAGS) $< >$@
  279. .cc.ii :
  280.     $(CPP) $(CPPFLAGS) $< >$@
  281. .h.i :
  282.     $(CPP) $(CPPFLAGS) $< >$@
  283.  
  284. C_SRC = \
  285.     $(srcdir)/clear.c \
  286.     $(srcdir)/tic.c \
  287.     $(srcdir)/toe.c \
  288.     $(srcdir)/dump_entry.c \
  289.     $(srcdir)/infocmp.c \
  290.     $(srcdir)/tput.c \
  291.     $(srcdir)/tset.c
  292.  
  293. lintlib :
  294.     @echo no action needed
  295.  
  296. # generated by mk-1st.awk
  297.  
  298. NORMAL_OBJS = \
  299.     ../objects/clear.o \
  300.     ../objects/tic.o \
  301.     ../objects/toe.o \
  302.     ../objects/dump_entry.o \
  303.     ../objects/infocmp.o \
  304.     ../objects/tput.o \
  305.     ../objects/tset.o
  306.  
  307. $(NORMAL_OBJS) : ../include/ncurses_cfg.h ./progs.priv.h
  308.  
  309. mostlyclean::
  310.     -rm -f $(NORMAL_OBJS)
  311.  
  312. clean ::
  313.     -rm -f $(NORMAL_OBJS)
  314.  
  315. # generated by mk-2nd.awk
  316.  
  317.  
  318. ../objects/clear.o :    $(srcdir)/clear.c \
  319.             ../include/term.h
  320.     cd ../objects; $(LIBTOOL) $(CC) $(CFLAGS_NORMAL) -c ../progs/clear.c
  321.  
  322. ../objects/tic.o :    $(srcdir)/tic.c \
  323.             ../include/term.h \
  324.             $(INCDIR)/tic.h \
  325.             $(srcdir)/dump_entry.h
  326.     cd ../objects; $(LIBTOOL) $(CC) $(CFLAGS_NORMAL) -c ../progs/tic.c
  327.  
  328. ../objects/toe.o :    $(srcdir)/toe.c \
  329.             ../include/term.h \
  330.             $(INCDIR)/tic.h \
  331.             $(srcdir)/dump_entry.h
  332.     cd ../objects; $(LIBTOOL) $(CC) $(CFLAGS_NORMAL) -c ../progs/toe.c
  333.  
  334. ../objects/dump_entry.o :    $(srcdir)/dump_entry.c \
  335.             ../include/term.h \
  336.             $(INCDIR)/tic.h \
  337.             $(srcdir)/dump_entry.h \
  338.             ../include/parametrized.h \
  339.             $(INCDIR)/capdefaults.c \
  340.             termsort.c
  341.     cd ../objects; $(LIBTOOL) $(CC) $(CFLAGS_NORMAL) -c ../progs/dump_entry.c
  342.  
  343. ../objects/infocmp.o :    $(srcdir)/infocmp.c \
  344.             ../include/term.h \
  345.             $(INCDIR)/tic.h \
  346.             $(srcdir)/dump_entry.h
  347.     cd ../objects; $(LIBTOOL) $(CC) $(CFLAGS_NORMAL) -c ../progs/infocmp.c
  348.  
  349. ../objects/tput.o :    $(srcdir)/tput.c \
  350.             ../include/term.h
  351.     cd ../objects; $(LIBTOOL) $(CC) $(CFLAGS_NORMAL) -c ../progs/tput.c
  352.  
  353. ../objects/tset.o :    $(srcdir)/tset.c \
  354.             ../include/term.h
  355.     cd ../objects; $(LIBTOOL) $(CC) $(CFLAGS_NORMAL) -c ../progs/tset.c
  356.  
  357. depend : $(AUTO_SRC)
  358.     makedepend -- $(CPPFLAGS) -- $(C_SRC)
  359.  
  360. # DO NOT DELETE THIS LINE -- make depend depends on it.
  361.